﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GetServiceReference;

public partial class UserControl_SearchUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetItemServiceClient gis = new GetItemServiceClient();
            List<Category> categorys = gis.getAllCategory().ToList();
            Category allcate = new Category();
            allcate.Category_ID = default(Guid);
            allcate.Category_Name = "All";
            categorys.Insert(0, allcate);
            categoryList.DataSource = categorys;
            categoryList.DataBind();
        }
    }
    protected void searchIcon_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("SearchPage.aspx?name=" + itemName.Text + "&category=" + categoryList.SelectedValue + "&price=" + priceList.SelectedValue);
    }
}